home *** CD-ROM | disk | FTP | other *** search
/ AI Game Programming Wisdom / AIGameProgrammingWisdom.iso / SourceCode / 03 Pathfinding with Astar / 04 Higgins / Listing5.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2001-12-09  |  954 b   |  27 lines

  1. /* Copyright (C) Dan Higgins, 2001. 
  2.  * All rights reserved worldwide.
  3.  *
  4.  * This software is provided "as is" without express or implied
  5.  * warranties. You may freely copy and compile this source into
  6.  * applications you distribute provided that the copyright text
  7.  * below is included in the resulting source code, for example:
  8.  * "Portions Copyright (C) Dan Higgins, 2001"
  9.  */
  10.  
  11. // An example of some of the FastStorage methods that were overloaded are:
  12.  
  13. inline void AddNodeToOpenList(AStarNode* inNode)
  14. { // call base class version.
  15.     AStarStorage::AddNodeToOpenList(inNode);
  16.     // Add it to our own node sliding window array.
  17.     this->AddNodeToNodeTable(inNode->mX, inNode->mY, inNode);
  18. }
  19.  
  20. inline AStarNode* FindNodeInClosedList(long inX, long inY)
  21. { // the flags array will tell us if we should return it
  22.     if(this->GetIsClosed(this->GetFlagForTile(inX,inY))
  23.         return this->GetNodeFromNodeTable(inX, inY);
  24.     else
  25.         return NULL;
  26. }
  27.